<template>
    <div class="kecheng">
        <el-row>
            <el-button class="addbtn">添加考题</el-button>
        </el-row>
          <el-table
            :height="tabheight"
            :data="tableData"
            style="width: 100%">
            <el-table-column
              prop="date"
              label="考题分类"
              >
            </el-table-column>
            <el-table-column
              prop="name"
              label="题型"
              >
            </el-table-column>
            <el-table-column
              prop="address"
              label="分值操作">
            </el-table-column>
                <el-table-column
              prop="address"
              label="操作">
            </el-table-column>
          </el-table>
    </div>
</template>
<script>
import {mapState} from "vuex"
import {getwenjuanlist} from "@/api/expend/index.js"
export default {
    name:'wenjuan',
    data(){
        return {
            tabheight:0,
            tableData:[],
            wenjuanfrom :{
                identification:'',
                page:0,//页码值
                limit:10,//条数
                name:''
            }
        }
    },
    computed:{
        ...mapState(['userInfo'])
    },
    methods:{
        // 获取问卷调查表
        async getwenjuan(){
            const data = await getwenjuanlist(this.wenjuanfrom)
            if(data.code === 1) {
                 this.tableData  = data.data
                 this.$message({
                   message: data.msg,
                   type: 'success'
                 });
            }else{
                this.$message.error('获取失败')
            }
            console.log(data);
        },
        // 表格高度自适应
    },
    mounted(){
        this.wenjuanfrom.identification = this.userInfo.identification
        this.getwenjuan()

    }
    
}
</script>
<style lang="less" scoped>
.kecheng {
    padding: 30px;
}

</style>